//
//  WmcBasicPlaceholderView.swift
//  YPWatermarkCamera
//
//  Created by yupao_ios_macmini06 on 2022/11/2.
//

import UIKit

// MARK: - [WmcBasicPlaceholderView]

class WmcBasicPlaceholderView: UIView {
    // Lifecycle

    override init(frame: CGRect) {
        super.init(frame: frame)

        setupView()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        setupView()
    }

    // Internal

    let centerView: UIView = .init()

    func setupView() {
        backgroundColor = UIColor.white

        centerView.translatesAutoresizingMaskIntoConstraints = false
        self.addSubview(centerView)
        centerView.snp.makeConstraints { make in
            make.top.left.right.bottom.equalToSuperview()
        }

//        let vConstraints = NSLayoutConstraint.constraints(withVisualFormat: "|-(>=20)-[centerView]-(>=20)-|", options: .alignAllCenterX, metrics: nil, views: ["centerView": centerView])
//        let hConstraint = NSLayoutConstraint(item: centerView, attribute: .centerY, relatedBy: .equal, toItem: self, attribute: .centerY, multiplier: 1.0, constant: 0.0)
//        let centerConstraint = NSLayoutConstraint(item: centerView, attribute: .centerX, relatedBy: .equal, toItem: self, attribute: .centerX, multiplier: 1.0, constant: 0.0)
//        centerConstraint.priority = .defaultHigh
//        //centerConstraint.priority = 750
//
//        addConstraints(vConstraints)
//        addConstraint(hConstraint)
//        addConstraint(centerConstraint)
    }
}
